"""
@creative_time = 2025/10/21 18:38
"""


class Rectangle:
    def __init__(self, length, width):
        self.length_ = length
        self.width_ = width

    def area(self):  # 求面积
        print(f"该矩形的面积为:{self.length_ * self.width_}")

    def perimeter(self):  # 求周长
        print(f"该矩形周长为:{2*(self.length_ + self.width_)}")

    def is_square(self):  # 检验是否为正方形
        if self.length_ == self.width_:
            print("True")
        else:
            print("False")

    def scale(self, factor):  # 缩放
        self.length_ *= factor
        self.width_ *= factor
        print(f"缩放后矩形的长:{self.length_},矩形的宽:{self.width_}")


Rec1 = Rectangle(5, 3)

Rec1.area()
Rec1.perimeter()
Rec1.is_square()
Rec1.scale(2)
